jQuery.extend(jQuery.validator.messages, {
    required: "必选字段",
    remote: "该字段已存在",
    email: "请输入正确格式的电子邮箱",
    url: "请输入合法的网址",
    date: "请输入合法的日期",
    dateISO: "请输入合法的日期 (ISO).",
    number: "请输入合法的数字",
    digits: "只能输入整数",
    creditcard: "请输入合法的信用卡号",
    equalTo: "两次密码不一致",
    accept: "请输入拥有合法后缀名的字符串",
    maxlength: jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"),
    minlength: jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"),
    rangelength: jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),
    range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
    max: jQuery.validator.format("请输入一个最大为 {0} 的值"),
    min: jQuery.validator.format("请输入一个最小为 {0} 的值")
});


jQuery.validator.addMethod("sqlValida", function (value, element) {
    var decimal = /select|update|delete|exec|create|drop|alter|count|'|"|=|;|>|<|%/gi;
    return this.optional(element) || !(decimal.test(value));
}, $.validator.format("请您不要在参数中输入特殊字符和SQL关键字！"));

jQuery.validator.addMethod("decimal", function (value, element) {
    var decimal = /^\d{1,8}(\.\d{1,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("金额有误，请重新输入"));
jQuery.validator.addMethod("decimalFor6", function (value, element) {
    var decimal = /^\d{1,6}(\.\d{1,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("只能输入六位整数且最多两位小数"));
jQuery.validator.addMethod("int", function (value, element) {
    var decimal = /^[0-9]*[0-9][0-9]*$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入非负整数!(不能有空格)"));

jQuery.validator.addMethod("aint", function (value, element) {
    var decimal = /^-?[0-9]+$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入整数!(不能有空格)"));

jQuery.validator.addMethod("aintAndZ", function (value, element) {
    var decimal =  	/^[1-9][0-9]*$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入非0正整数"));

jQuery.validator.addMethod("feiLandZ", function (value, element) {
    var decimal =  	/^(0|\+?[1-9][0-9]*)$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入0或者正整数"));

jQuery.validator.addMethod("fint", function (value, element) {
    var decimal = /^[0-9a-zA-Z]{4}$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入4位标识编号!"));

jQuery.validator.addMethod("nint", function (value, element) {
    var decimal = /^[0-9]{1,10}$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入十位以内的非负整数!(不能有空格)"));

jQuery.validator.addMethod("fare", function (value, element) {
    var decimal = /^\d{1,2}(\.\d{0,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入正确的数字 !"));

jQuery.validator.addMethod("disNum", function (value, element) {
    var decimal = /^\d{1,2}(\.\d{0,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入正确的数字 !(数字格式为xx.xx小数部分可省略)"));
jQuery.validator.addMethod("credit",function(value,element) {
	var decimal = /^(([1-9]\d{0,9})|0)(\.\d{1,2})?$/;
	return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入正确的金额 !"));
jQuery.validator.addMethod("nuclearLoad", function (value, element) {
    var decimal = /^((-1)?|[0-9]\d*)(\.\d{0,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入正确的数字 (小数最多两位)!"));
jQuery.validator.addMethod("javaInt", function (value, element) {
	var decimal = /^\d{1,8}(\.\d{0,2})?$/;
	return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入一个在0~20000000的数字 (小数最多两位)!"));
jQuery.validator.addMethod("number12_2", function (value, element) {
	var decimal = /^[1-9]\d{0,9}(\.\d{1,2})?$/;
	return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入一个正确的数字 (整数最多十位，小数最多两位)!"));
jQuery.validator.addMethod("number10_2", function (value, element) {
	var decimal = /^(([1-9]\d{0,7})|0)(\.\d{1,2})?$/;
	return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入一个正确的数字 (整数最多八位，小数最多两位)!"));
jQuery.validator.addMethod("javaIntNo", function (value, element) {
	var decimal = /^\d{1,8}$/;
	return this.optional(element) || (decimal.test(value));
}, $.validator.format("请输入一个在0~20000000的数字 (无小数点)!"));

jQuery.validator.addMethod("inta", function (value, element) {
    var decimal = /^[0-9]*[1-9][0-9]*$/;
    return this.optional(element) || (decimal.test(value) && value <= 60);
}, $.validator.format("请输入一个1-60的整数!"));

jQuery.validator.addMethod("percent", function (value, element) {
    var decimal = /^[0-9]*[0-9][0-9]*$/;
    return this.optional(element) || (decimal.test(value) && value <= 100);
}, $.validator.format("请输入一个0-100的整数!"));

jQuery.validator.addMethod("maxlengthTwenty", function (value, element) {
    return this.optional(element) || ((Len(value) <= 45));
}, $.validator.format("长度不能大于45（汉字算三个)"));

jQuery.validator.addMethod("maxlengthRemark", function (value, element) {
    return this.optional(element) || ((Len(value) <= 255));
}, $.validator.format("长度不能大于255（汉字算三个)"));

jQuery.validator.addMethod("max100000", function (value, element) {
    return this.optional(element) || (value <= 100000);
}, $.validator.format("不能大于100000"));

jQuery.validator.addMethod("jpgFile", function (value, element) {
    var temp = value.substring(value.length - 4, value.length);
    return this.optional(element) || (temp == ".jpg");
}, $.validator.format("*.jpg"));

jQuery.validator.addMethod("ftN", function (value, element) {
    var decimal = /^[0-9]*[1-9][0-9]*$/;
    return this.optional(element) || (decimal.test(value) && Len(value) == 14);
}, $.validator.format("输入14位卡号"));
jQuery.validator.addMethod("UID", function (value, element) {
    //var decimal = /^[A-Za-z0-9]*[A-Za-z0-9]*$/;
    var decimal = /^(\d{17})(\d|[xX])$/;//身份证号码是18位，其中最后一位可以是X。其它全是数字
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("18位身份证号码"));
jQuery.validator.addMethod("maxlength_T", function (value, element, param) {
    return this.optional(element) || ((Len(value) <= param));
}, $.validator.format("长度不能大于 {0} （汉字算三个)"));
jQuery.validator.addMethod("maxlength_alnum", function (value, element, param) {
    return this.optional(element) || ((Len(value) <= param));
}, $.validator.format("长度不能大于 {0}"));
jQuery.validator.addMethod("numbMax_L", function (value, element,param) {
    var decimal = /^[1-9][0-9]*$/;
    return this.optional(element) || ((decimal.test(value) && Len(value) <= param));
}, $.validator.format("长度不能大于{0}位的整数"));

jQuery.validator.addMethod("mobile", function (value, element) {
    var length = value.length;
    //var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
    var mobile = /^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8]))\d{8}$/;
    return this.optional(element) || (length == 11 && mobile.test(value));
}, "请正确填写您的手机号码");
//((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)
jQuery.validator.addMethod("tel", function (value, element) {
    var length = value.length;
    var mobile = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/g;
    return this.optional(element) || (length == 11 && mobile.test(value));
}, "请正确填写您的联系电话");

jQuery.validator.addMethod("onlyDig", function (value, element) {
    return this.optional(element) || /^\d+$/.test(value);
}, "请输入数字");


jQuery.validator.addMethod("alnum", function (value, element) {
    return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value);
}, "只能包括英文字母和数字");

jQuery.validator.addMethod("alnum2", function (value, element) {
    return this.optional(element) || /^[a-zA-Z0-9-]+$/.test(value);
}, "只能包括英文字母，数字和-");
jQuery.validator.addMethod("alnum3", function (value, element) {
    return this.optional(element) || /^[A-Za-z\d-._]+$/.test(value);
}, "不允许输入中文字符");

jQuery.validator.addMethod("otherCode", function (value, element) {
    var temp = /^[\u4e00-\u9fa5A-Za-z0-9]+$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("只能包括英文字母，数字和中文"));

jQuery.validator.addMethod("vehiclePlate", function (value, element) {
   /* var temp = /^(([\u4e00-\u9fa5]{1})|([A-Z]{1}))[A-Z]{1}[A-Z0-9]{4}(([\u4e00-\u9fa5]{1})|([A-Z0-9]{1}))$/;
    var temp1 = /^WJ[0-9]{2}(([\u4e00-\u9fa5]{1})|([0-9]{1})[0-9]{4})$/;
    var temp2 = /^([\u4e00-\u9fa5]*[a-zA-Z0-9]+){6,}$/;
    var temp3 = /^.{3}((?!.*O)(?!.*I)).*$/;
    return this.optional(element) || ((temp.test(value)) || (temp1.test(value)))&&(temp2.test(value))&&(temp3.test(value));*/
	
	//澳门的车牌验证不一样
	var temp = /^([\u4e00-\u9fa5]|[A-Z]){1}[A-Z]{1}[A-Z0-9]{4}([\u4e00-\u9fa5]|[A-Z0-9])$/;
	var temp1 =/^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z0-9]{1}[A-Z0-9]{1}([京津沪渝桂蒙宁新藏冀晋辽吉黑苏浙皖赣闽鲁粤鄂湘豫川云贵陕甘青琼])?[A-HJ-Z0-9]{1}[A-NP-Z0-9]{3}[A-NP-Z0-9挂学警港澳领试超外]{1}([A-HJ-NP-Z0-9外])?)|([A-Z0-9]{7})$/;
	return this.optional(element) || ((temp.test(value)) && (temp1.test(value)));
}, $.validator.format("请输入正确的车牌号码"));

jQuery.validator.addMethod("sysUpdatePwd", function (value, element) {
	var a = /^[\x21-\x7e]{8,20}$/;
    var b = /^[0-9]{8,20}$/;
    var c = /^[A-Za-z]{8,20}$/;
    var d = /^[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]{8,20}$/;
    return this.optional(element) || (((a.test(value)) == true && (b.test(value) == false) && (c.test(value) == false) && (d.test(value) == false)));
}, $.validator.format("请输入8~20位密码，其中至少包含数字字母特殊字符中的两种"));

jQuery.validator.addMethod("customer", function (value, element) {
    var temp = /^[\u4e00-\u9fa5A-Za-z0-9]+$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("请输入正确客户名称"));

jQuery.validator.addMethod("identificationCode", function (value, element) {
    var temp = /^[A-Z0-9]{6,17}$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("请输入正确车辆识别码"));

jQuery.validator.addMethod("identificationCode6", function (value, element) {
    var temp = /^[A-Z0-9]{6}$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("请输入车辆识别码后六位"));


jQuery.validator.addMethod("tagNO", function (value, element) {
    var temp = /^[0-9]{16}$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("请输入正确的16位十进制电子标签号"));

jQuery.validator.addMethod("vehicleEngineNo", function (value, element) {
    var temp = /^[A-Z0-9]+$/;
    return this.optional(element) || (temp.test(value));
}, $.validator.format("请输入正确发动机型号"));


jQuery.validator.addMethod("multiples", function (value, element, param) {
    return this.optional(element) || ((value % param) == 0);
}, $.validator.format("必须是{0}的倍数"));

jQuery.validator.addMethod("nullormorethan", function (value, element,param) {
	return this.optional(element) || (value=='') || (Len(value) >= param);
}, $.validator.format("必须为0或大于6的字符串"));

jQuery.validator.addMethod("nospace", function (value, element) {
	var rep = /[\s]{1}/;
	return (!(rep.test(value)));
}, $.validator.format("请不要输入空格或者制表符等"));

jQuery.validator.addMethod("bankName", function (value, element) {
	var rep = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/;
	return this.optional(element) || (rep.test(value));
}, $.validator.format("只允许输入中文、数字和字母"));

jQuery.validator.addMethod("containTab", function (value, element) {
	return !(value.indexOf("\t")>=0);
}, $.validator.format("不能含有tab制表符"));
/*
 校验卡表面号和车牌是否一致
 */
jQuery.validator.addMethod("faceCardNumCorrect", function (value, element) {
    var response;
    //alert(value+":"+element+":"+params);
    var dom = jQuery(element).parents("tr").find("td > input[name*=vehiclePlate]");
    var vehplate = dom.attr('value');
    /* $("input[name*=vehiclePlae]").each */
    var datas = {};
    datas.cardNum = value;
    datas.plate =  encodeURIComponent(vehplate);
    $.ajax({
        type: "POST",
        url: "upgrade_checkPlate.do",
        data: datas,
        async: false,
        success: function (data) {
            response = data;
        }
    });
    if (response == 1) {
        return true;
    }
    else if (response == 0) {
        return false;
    }
}, "卡表面号和车牌不一致");

/*
 车牌和校验卡表面号是否一致
 */
jQuery.validator.addMethod("vehPlateCorrect", function (value, element) {
    var response;
    var dom = jQuery(element).parents("tr").find("td > input[name*=faceCardNum]");
    var faceCardNum = dom.attr('value');

    var datas = {};
    datas.cardNum = faceCardNum;
    datas.plate =  encodeURIComponent(value);
    $.ajax({
        type: "POST",
        url: "upgrade_checkPlate.do",
        data: datas,
        async: false,
        success: function (data) {
            response = data;
        }
    });
    if (response == 1) {
        return true;
    }
    else if (response == 0) {
        return false;
    }
}, "车牌和卡表面号不一致");

/*
 卡类型输入是否正确
 */
jQuery.validator.addMethod("cardTypeInput", function (value, element) {
    var dom = jQuery(element).parents("tr").find("td > input[name*=cardType]");
    var cardType = dom.attr('value');

    if (cardType == "储值卡"||cardType == "记帐卡") {
        return true;
    }
    else  {
        return false;
    }
}, "卡类型需填储值卡或者记帐卡");

jQuery.validator.addMethod("zipCode", function(value, element) {  
    var tel = /^[0-9]{6}$/;
    return this.optional(element) || (tel.test(value));
}, "请正确填写您的邮政编码");

jQuery.validator.addMethod("areaExist", function (value, element) {
    var flag = 1;
    $.ajax({
        type: "POST",
        url: "area_checkNameExist.do",
        async: false,
        data: {'area.name': value},
        success: function (msg) {
            if (msg == "true") {
                flag = 0;
            }
        }
    });
    if (flag == 0) {
        return false;
    } else {
        return true;
    }
});
jQuery.validator.addMethod("myRemote", function (value, element, param) {
    //var flag=1;

    var datas = {};
    var validator = this;
    datas[$(element).attr("name")] = value;
    var previous = validator.previousValue(element);
    $.ajax({
        type: "GET",
        url: param,
        async: false,
        data: datas,
        success: function (msg) {
            var valid = false;
            if (msg == "true") {
                var submitted = validator.formSubmitted;
                validator.prepareElement(element);
                validator.formSubmitted = submitted;
                validator.successList.push(element);
                validator.showErrors();
                valid = true;
            } else {
                var errors = {};
                if (msg.length > 20) {
                    msg = "系统错误！";
                }
                if (msg == "false") {
                    var message = validator.defaultMessage(element, "myRemote");
                } else {
                    var message = msg;
                }

                //var message = response!=null;

                errors[element.name] = message;
                validator.showErrors(errors);
                valid = false;
                validator.formSubmitted = false;
            }
            previous.valid = valid;
            validator.stopRequest(element, valid);

        }
    });
    return "pending";

});

//IP地址验证
jQuery.validator.addMethod("ip", function(value, element) {
	var ip = /^((22[0-3])|(2[0-1][0-9])|(1[0-9][0-9])|([1-9][0-9])|([1-9]))(\.((25[0-5])|(2[0-4][0-9]|(1[0-9][0-9])|([1-9][0-9])|([0-9])))){3}$/;
    return this.optional(element) || (ip.test(value));
}, "Ip地址格式错误");

//编号验证
jQuery.validator.addMethod("IsNumber", function(value, element, param) {
	 var values = /^((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([1-9]))$/;
	 return this.optional(element) || values.test(value);
},"请输入1-255的整数(不能有空格)");

//Time类型验证
jQuery.validator.addMethod("times", function(value, element) {
    var times = /^(([0-1][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9]$/;
    return this.optional(element) || times.test(value);
}, "时间格式错误");
jQuery.validator.addMethod("decimalsmall", function (value, element) {
    var decimal = /^\d{1,8}(\.\d{1,2})?$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("输入有误!"));
jQuery.validator.addMethod("nintsmall", function (value, element) {
	var decimal = /^[0-9]{1,10}$/;
    return this.optional(element) || (decimal.test(value));
}, $.validator.format("输入有误!"));
//Time类型验证
jQuery.validator.addMethod("datetimes", function(value, element) {
    var datetimes = /^\d{4}[-]\d{2}[-]\d{2} (([0-1][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9]\.{0,1}\d{0,3}$/;
    return this.optional(element) || datetimes.test(value);
}, "日期格式错误");

/*YGZ 营改增新增校验规则 ---------------------start------------------以收费公路联网收费数据编码正则表达式v1.0为准，辅助其他身份正则*/
jQuery.validator.addMethod("YEmail", function(value, element) {
    var email = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    return this.optional(element) || email.test(value);
}, "请输入正确格式的电子邮箱");

/*YGZ RuiHaoZ Add 校验输入？营业执照或三证合一营业执照或信用代码*/
jQuery.validator.addMethod("YLicence", function(value, element) {
    var temp =/^(([A-Z0-9]{15})|([A-Z0-9]{18}))$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的证件号码");
/*YGZ RuiHaoZ Add 校验输入？组织机构证*/
jQuery.validator.addMethod("YOrganization", function(value, element) {
    var temp =/(^[0-9A-Z]{9}$|^[0-9A-Z]{8}$|^[0-9A-Z]{8}\-[0-9A-Z]{1}$)/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的组织机构证");

/*YGZ wangjinhao Add 校验输入? 车牌信息*/
jQuery.validator.addMethod("YVehiclePlateNormal", function(value, element) {
    var temp = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9使领挂学警港澳]{1}$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的车牌信息");
jQuery.validator.addMethod("YVehiclePlateSmallNewEnergy", function(value, element) {
    var temp = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-Z]{1}[DF]{1}[A-HJ-NP-Z0-9]{5}$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的车牌信息");
jQuery.validator.addMethod("YVehiclePlateBigNewEnergy", function(value, element) {
    var temp = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{5}[DF]{1}$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的车牌信息");
jQuery.validator.addMethod("YVehiclePlatePolice", function(value, element) {
    var temp = /^[A-Z]{2}[0-9]{0,2}[-]{0,1}[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼A-HJ-NP-Z0-9]{0,1}[A-HJ-NP-Z0-9]{5}$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的车牌信息");
/*YGZ wangjinhao Add 校验输入？车辆识别号*/
jQuery.validator.addMethod("YIdentificationCode", function(value, element) {
    var temp =/^[A-Z0-9]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的车辆识别号");
/*YGZ wangjinhao Add 校验输入？发动机号*/
jQuery.validator.addMethod("YEngineNo", function(value, element) {
    var temp =/^[A-Z0-9-]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的发动机号");
/*YGZ wangjinhao Add 校验输入？档案编号*/
jQuery.validator.addMethod("YFileNo", function(value, element) {
    var temp =/^[A-Z0-9]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的档案编号");
/*YGZ wangjinhao Add 校验输入？校验记录*/
jQuery.validator.addMethod("YTestRecord", function(value, element) {
    var temp =/^[a-zA-Z0-9\u4e00-\u9fa5\(\)]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的校验记录");
jQuery.validator.addMethod("YHkCode", function(value, element) {
    var temp =/^[A-Za-z]{1,2}\d{6}\([0-9aA]\)$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的香港身份证");
jQuery.validator.addMethod("YBussiness", function(value, element) {
    var temp =/^[0-9]{8}$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的商业登记证");
jQuery.validator.addMethod("YMCCode", function(value, element) {
    var temp =/^[1|5|7][0-9]{6}\([0-9Aa]\)/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的澳门身份证");//5215299(8)
jQuery.validator.addMethod("YSecondNo", function(value, element) {
    var temp =/^\d{10}$/;
    return this.optional(element) || temp.test(value);
}, "请输入10位数字的二级编码");
jQuery.validator.addMethod("YSecondName", function(value, element) {
    var temp =/^[\u4e00-\u9fa5]{1,20}$/;
    return this.optional(element) || temp.test(value);
}, "请输入20个中文字体以内");
//所有个人用户，联系人之类
jQuery.validator.addMethod("VName1", function(value, element) {
    var temp =/(^[A-Za-z\s••.]+$)|(^[\u2E80-\uFE4F••.]+$)/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
//所有单位名称类的字段，如发行方、公路方
jQuery.validator.addMethod("VName2", function(value, element) {
    var temp =/^[\u2E80-\uFE4F\w\(\)（）.\-••—/&《》]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的单位名称");
//所有地址相关
jQuery.validator.addMethod("VAddress", function(value, element) {
    var temp =/^[\u2E80-\uFE4F\w\(\)（）\-—.+/:：#&*《》、，,。~••“”"【】\[\]]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的地址");
//vehicleType，vehicleModel，用户卡model，OBU信息model
jQuery.validator.addMethod("VFilter", function(value, element) {
    var temp =/^[\u2E80-\uFE4F\(\)（）\w.+\-·•—/]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
jQuery.validator.addMethod("VVIN", function(value, element) {
    var temp =/^[\w\-/\+]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
jQuery.validator.addMethod("VEngineNum", function(value, element) {
    var temp =/^[\w\-/\+\*\s\u2E80-\uFE4F—]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
//护照、港澳居民来往内地通行证、台湾居民来往大陆通行证、统一社会信用代码证书、组织机构代码证、营业执照、律师事务所执业许可证
jQuery.validator.addMethod("VCode1", function(value, element) {
    var temp =/^[\w\(\)\-（）—/]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
jQuery.validator.addMethod("VUid", function(value, element) {
    var temp =/^(11|12|13|14|15|21|22|23|31|32|33|34|35|36|37|41|42|43|44|45|50|51|52|53|61|62|63|64|65)\d{15}(\d{1}|X)$/;
    return this.optional(element) || temp.test(value);
}, "请输入正确格式的身份证");
//武警、军官证、事业单位法人证书、社会团体法人登记证书
jQuery.validator.addMethod("VCode2", function(value, element) {
    var temp =/^[\u2E80-\uFE4F\w\-—]+$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的证件号码");
//199、299 使用该证件类型的客户，在发票服务平台无法绑定卡片，无法开具发票
jQuery.validator.addMethod("VCode3", function(value, element) {
    var temp =/^[\u2E80-\uFE4F\(\)（）\w.+\-••\\—/]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的证件号码");
jQuery.validator.addMethod("VCarCard", function(value, element) {
	var temp =/^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z0-9]{1}[A-Z0-9]{1}([京津沪渝桂蒙宁新藏冀晋辽吉黑苏浙皖赣闽鲁粤鄂湘豫川云贵陕甘青琼])?[A-HJ-Z0-9]{1}[A-NP-Z0-9]{3}[A-NP-Z0-9挂学警港澳领试超外]{1}([A-HJ-NP-Z0-9外])?)|([A-Z0-9]{7})$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的车牌信息");
//手机
jQuery.validator.addMethod("VMobile", function(value, element) {
    var temp =/^1[3|4|5|7|8|9][0-9]{9}$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的手机号码");
//座机+手机
jQuery.validator.addMethod("VTel", function(value, element) {
    var temp =/^0[1-9][0-9]{1,2}-[1-9][0-9]{5,7}(-[0-9]{1,4})?|1[3|4|5|7|8|9][0-9]{9}$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的座机或手机号码");

jQuery.validator.addMethod("VBusinessHours", function(value, element) {
    var temp =/^[每月年节假周天第休息一二三四五六日至，.或星期:0-9\-\s,AMamPMpm]*$/;
    return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
/*YGZ 营改增新增校验规则 ---------------------end------------------ V为部中心标准 Y为营改增参考*/

// 营改增车主名称新正则
jQuery.validator.addMethod("VCarName", function(value, element) {
    var temp =/(^[\u2E80-\uFE4F\w()（）.\-·•—/&《》]+$)|(^[a-zA-Z]+[A-Za-z\s·•.]+[a-zA-Z]+$)|(^[\u2E80-\uFE4F·•.]+$)/;
	return this.optional(element) || temp.test(value);
}, "请输入符合规范的信息");
